home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / artFluidAttrAutoSaveInitialS1 < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.1 KB  |  67 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  May 2000 
  22. //
  23. //
  24. //
  25. // Procedure Name:
  26. //     artFluidAttrAutoSaveInitialStateCurrentFluid
  27. //
  28. // Description:
  29. //     Normally, this would be just as simple as a
  30. //     "performFluids 1 FluidSave 0" but in case the selection
  31. //     list has changed, we're still holding on to an autoSave
  32. //     flag for the last painted fluid (which might no longer
  33. //     be selected!) so we might need to reselect the fluid before
  34. //     invoking the performFluids autoSave cmd...
  35. //    
  36. //  Return Value:
  37. //      None.
  38. //
  39. global proc artFluidAttrAutoSaveInitialStateCurrentFluid( string $tool )
  40. {
  41.     // We're responding to an "autoSave" request...  Check and
  42.     // see if the fluid we want to save is actually on the selection
  43.     // list.  If not, invoking FluidSave will produce an error, so
  44.     // we'd better select it beforehand.
  45.     //
  46.     string $fluid = `artFluidAttrCtx -q -currentPaintableFluid $tool`;
  47.     if( size( $fluid ) == 0 ) {
  48.         return;
  49.     }
  50.  
  51.     string $selList[] = `ls -sl`;
  52.     int    $fluidSelected = ( stringArrayCount( $fluid, $selList ) > 0 );
  53.     if( !$fluidSelected ) {
  54.         select $fluid;
  55.     }
  56.  
  57.     // Save the state.
  58.     //
  59.     SetInitialState;
  60.  
  61.     // Restore the selection list if we need to.
  62.     //
  63.     if( !$fluidSelected ) {
  64.         select $selList;
  65.     }
  66. }
  67.